package com.paranoidmonkey.ode.Joint;

import com.paranoidmonkey.ode.AndrODE;
import com.paranoidmonkey.ode.World;

public class Piston extends Joint {
	public Piston(World world,JointGroup group){
		handle=AndrODE.dJointCreatePiston (world.getHandle(), group.groupID);
	}
	public void setAnchor(float x, float y, float z){
		AndrODE.dJointSetPistonAnchor (handle, x, y, z);
	}
	public void setAnchorOffset(float x, float y, float z, float dx, float dy, float dz){
		AndrODE.dJointSetPistonAnchorOffset(handle, x, y, z, dx, dy, dz);
	}
	public void setAxis(float x, float y, float z){
		AndrODE.dJointSetPistonAxis (handle, x, y, z);
	}
	public void setParam(int parameter, float value){
		AndrODE.dJointSetPistonParam (handle, parameter, value);
	}
	public void setForce(float force){
		AndrODE.dJointAddPistonForce (handle, force);
	}
	public float getPosition(){
		return AndrODE.dJointGetPistonPosition (handle);
	}
	public float getPositionRate(){
		return AndrODE.dJointGetPistonPositionRate (handle);
	}
	public float getAngle(){
		return AndrODE.dJointGetPistonAngle (handle);
	}
	public float getAngleRate(){
		return AndrODE.dJointGetPistonAngleRate (handle);
	}
	public void getAnchor(float[] result){
		AndrODE.dJointGetPistonAnchor (handle, result);
	}
	public void getAnchor2(float[] result){
		AndrODE.dJointGetPistonAnchor2 (handle, result);
	}
	public void getAxis(float[] result){
		AndrODE.dJointGetPistonAxis (handle, result);
	}
	public float getParam(int parameter){
		return AndrODE.dJointGetPistonParam (handle, parameter);
	}

}
